package com.hfi.dao;

import com.hfi.model.Employee;
import com.hfi.mymap.MyParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author ChangLiang
 * @date 2019/5/15
 */
public interface EmployeeMapper {
    Employee getEmployeeById(Integer id);

    Long addEmp(Employee employee);

    boolean updateEmp(Employee employee);

    void deleteEmpById(Integer id);

    Employee getEmpByIdAndLastName(@Param("id")Integer id, @Param("lastName")String lastName);

    Employee getEmpByMyIdAndLastName(@MyParam("id")Integer id, @MyParam("lastName")String lastName);

    Employee getEmpByMap(Map<String, Object> map);

    List<Employee> getEmpsByLastNameLike(String lastName);

    Map<String, Object> getEmpByIdReturnMap(Integer id);

    @MapKey("lastName")
    Map<String, Employee> getEmpByLastNameLikeReturnMap(String lastName);
}
